package com.rpframework.core.json;

/**
 * 数据已存在异常
 *
 * @author 刘兴
 */
public class ExistException extends JsonException {

    private String message;

    private JsonResp e = new JsonResp().code(JsonCodeEnum.EXISTING, message);


    /**
     * UID
     */
    private static final long serialVersionUID = 1L;

    public ExistException() {
        super();
        setJsonResp(e);
    }

    public ExistException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.message = message;
        e.setMsg(message);
        setJsonResp(e);
    }

    public ExistException(String message, Throwable cause) {
        super(message, cause);
        this.message = message;
        e.setMsg(message);
        setJsonResp(e);
    }

    public ExistException(String message) {
        super(message);
        this.message = message;
        e.setMsg(message);
        setJsonResp(e);
    }

    public ExistException(Throwable cause) {
        super(cause);
    }
}
